%jsroot on
TFile *ipf = new TFile("cal_16C.root");
TTree *tree = (TTree*)ipf->Get("tree");
TCanvas *c1=new TCanvas("c1","c1");
tree->Draw("y1hit:x1hit>>(6,0,6,6,0,6)","","colz");
gPad->SetLogz();
c1->Draw();
tree->Scan("x1s:int(x1e):y1s:int(y1e)","","",10,1);
tree->Scan("x1s:int(x1e):y1s:int(y1e)","x1hit==2 && abs(x1s[0]-x1s[1])>1 && y1hit==2","",200,1);
tree->Scan("x1s:int(x1e):y1s:int(y1e)","x1hit==2 && abs(x1s[0]-x1s[1])==1 && abs(x1e-y1e)<20 && y1hit==2","",1000,1);
tree->Scan("x1s:int(x1e):y1s:int(y1e)","x1hit==3 && abs(x1s[0]-x1s[1])>1","",500,1);
也可以清晰地看见有三个粒子入射的情况:
其他:
tree->Draw("sx1e:sy1e>>(1000,0,10000,1000,0,10000)","","colz");
gPad->SetLogz();
c1->Draw();
tree->Draw("sx1e:sx1e-sy1e>>(400,-400,400,500,0,8000)","","colz");
c1->Draw();
tree->Draw("sx1e:sx1e-sy1e>>hx1y1(400,-400,400,1000,0,8000)","x1hit==1&&y1hit==1","colz");
c1->Draw();//-10~+10
tree->Draw("sx1e:sx1e-sy1e>>(500,-500,500,1000,0,10000)","x1hit>y1hit","colz");
c1->Draw(); //-10~+60 x1hit=y1hit=2;
tree->Draw("sx1e:sx1e-sy1e>>(500,-500,500,1000,0,10000)","x1hit<y1hit","colz");
c1->Draw(); //-10~+60 x1hit=y1hit=2;
tree->Draw("sx1e:sx1e-sy1e>>(500,-500,500,1000,0,10000)","x1hit==2&&y1hit==2&&abs(x1s[0]-x1s[1])+abs(y1s[0]-y1s[1])>2","colz");
c1->Draw();//-10~+10 ; x1hit=y1hit==2
tree->Draw("sx1e:sx1e-sy1e>>(500,-500,500,1000,0,10000)","x1hit==3&&y1hit==3&&abs(x1s[0]-x1s[1])+abs(y1s[0]-y1s[1])>2","colz");
c1->Draw();//-10~+10 ; x1hit=y1hit==3
Int_t x1h,y1h,x2h,y2h,x3h,y3h;//final multiplicity
Double_t x1ea[100],x2ea[100],x3ea[100];//x-energy
Double_t y1ea[100],y2ea[100],y3ea[100];//y-energy
Int_t x1sa[100],x2sa[100],x3sa[100];//x-strip
Int_t y1sa[100],y2sa[100],y3sa[100];//y-strip
Int_t flag1,flag2,flag3;//event flag
////////////////////////////////////
//one-one DSSD1
if(x1hit==1 && y1hit==1 && abs(sx1e-sy1e)<10) {
x1h=1;y1h=1;
x1ea[0]=x1e[0]; x1sa[0]=x1s[0];
y1ea[0]=y1e[0]; y1sa[0]=y1s[0];
flag1=111;
}
////////////////////////////////////
////////////////////////////////////
//two-two DSSD1
if(x1hit==y1hit && x1hit==2) {
if(abs(x1e[0]-y1e[0])<10 && abs(x1e[1]-y1e[1])<10) {
x1h=2;y1h=2;
for(int i=0;i<2;i++) {
x1ea[i]=x1e[i]; x1sa[i]=x1s[i];
y1ea[i]=y1e[i]; y1sa[i]=y1s[i];
}
flag1=222;
}
else if(sx1e-sy1e>-10 && sx1e-sy1e<60) {
if(abs(x1s[0]-x1s[1])==1 && abs(y1s[0]-y1s[1])==1) {
x1h=1;y1h=1;
x1ea[0]=x1e[0]+x1e[1];
x1sa[0]=x1s[0];
y1ea[0]=y1e[0]+y1e[1];
y1sa[0]=y1s[0];
flag1=221;
}
}
}
//////////////////////////////////////
//three-two DSSD1
if(x1hit==2 && y1hit==3) {
if(sx1e-sy1e>-35 && sx1e-sy1e<10) {
int ix=-1,iy=-1;
for(int i=0;i<2;i++)
for(int j=0;j<3;j++) {
if(abs(x1e[i]-y1e[j])<10) {//search x-y pair
ix=i;
iy=j;
}
}
if(ix>-1) {
x1sa[0]=-1; x1sa[1]=-1;
y1sa[0]=-1; y1sa[1]=-1;
x1ea[0]=x1e[ix]; x1sa[0]=x1s[ix];
y1ea[0]=y1e[iy]; y1sa[0]=y1s[iy];
if(ix==0) {
x1ea[1]=x1e[1]; x1sa[1]=x1s[1];
}
else {
x1ea[1]=x1e[0]; x1sa[1]=x1s[0];
}
if(iy==0 &&abs(y1s[1]-y1s[2])==1) {
y1ea[1]=y1e[1]+y1e[2]; y1sa[1]=y1s[1];
}
if(iy==1 &&abs(y1s[0]-y1s[2])==1) {
y1ea[1]=y1e[0]+y1e[2]; y1sa[1]=y1s[0];
}
if(iy==2 &&abs(y1s[0]-y1s[1])==1) {
y1ea[1]=y1e[0]+y1e[1]; y1sa[1]=y1s[0];
}
if(x1sa[0]>-1 && x1sa[1]>-1 &&y1sa[0]>-1 && y1sa[1]>-1) {
x1h=2;y1h=2;
flag1=232;
}
}
}
}
if(x1hit==3 && y1hit==2) {
if(sx1e-sy1e>5 && sx1e-sy1e<65) {
int ix=-1,iy=-1;
for(int i=0;i<3;i++)
for(int j=0;j<2;j++) {
if(abs(x1e[i]-y1e[j])<10) {//search x-y pair
ix=i;
iy=j;
}
}
if(ix>-1) {
x1sa[0]=-1; x1sa[1]=-1;
y1sa[0]=-1; y1sa[1]=-1;
x1ea[0]=x1e[ix]; x1sa[0]=x1s[ix];
y1ea[0]=y1e[iy]; y1sa[0]=y1s[iy];
if(iy==0) {
y1ea[1]=y1e[1]; y1sa[1]=y1s[1];
}
else {
y1ea[1]=y1e[0]; y1sa[1]=y1s[0];
}
if(ix==0 &&abs(x1s[1]-x1s[2])==1) {
x1ea[1]=x1e[1]+x1e[2]; x1sa[1]=x1s[1];
}
if(ix==1 &&abs(x1s[0]-x1s[2])==1) {
x1ea[1]=x1e[0]+x1e[2]; x1sa[1]=x1s[0];
}
if(ix==2 &&abs(x1s[0]-x1s[1])==1) {
x1ea[1]=x1e[0]+x1e[1]; x1sa[1]=x1s[0];
}
if(x1sa[0]>-1 && x1sa[1]>-1 &&y1sa[0]>-1 && y1sa[1]>-1) {
x1h=2;y1h=2;
flag1=232;
}
}
}
}
... ... ...
if((x1h>0 && x1h==x2h && x3h==0) || (x1h>0 && x1h==x2h && x2h==x3h)) tree->Fill();
TFile *fsort=new TFile("sort_16C.root");
TTree *tr=(TTree*)fsort->Get("tree");
//hit: x1hit,x2hit,x3hit,y1hit,y2hit,y3hit;
//energy: x1e,x2e,x3e,y1e,y2e,y3e;
//strip: x1s,x2s,x3s,y1s,y2s,y2s;
tr->Draw("x1e:x2e>>(500,0,9000,500,0,8000)","","colz");
c1->Draw();
tr->Draw("x1e:x2e>>(500,0,9000,500,0,8000)","x1hit==1","colz");
c1->Draw();
tr->Draw("x1e:x2e>>(500,0,8000,500,0,8000)","x1hit==2","colz");
c1->Draw();
tr->Draw("x1e:x2e>>(500,0,8000,500,0,8000)","flag1==222 && flag2==222","colz");
c1->Draw();
tr->Draw("x1e:x2e>>(500,0,8000,500,0,8000)","flag1==222 && flag2==222 &&abs(x1s-x2s)<2 && abs(y1s-y2s)<2","colz");
c1->Draw();
tr->Draw("x2e:x3e>>(500,0,8000,500,0,8000)","flag2==222 && flag3==222 &&abs(x2s-x3s)<2 && abs(y2s-y3s)<2","colz");
c1->Draw();
tr->Scan("x1s:x2s:x3s:y1s:y2s:y3s","flag1==222 &&abs(x1s-x2s)>2","",2000,1);
//***********************************************************************************************
//* Row * Instance * x1s * x2s * x3s * y1s * y2s * y3s *
//***********************************************************************************************
//* 60 * 0 * 14 * 14 * 14 * 13 * 13 * 13 *
//* 60 * 1 * 4 * 2 * 1 * 16 * 16 * 16 *
//* 958 * 0 * 24 * 24 * 25 * 13 * 22 * 22 *
//* 958 * 1 * 16 * 16 * 16 * 21 * 12 * 12 *
按照如下条件重新进行多探测器之间事件匹配
tr->Scan("x1s:x2s:x3s:y1s:y2s:y3s","flag1==222 &&abs(x1s[0]-x1s[1])==1 && abs(x2s[0]-x2s[1])==1","",1000,1);